<?php

// 拍卖商品表

namespace app\console\model;

use think\Model;

class AuctionGoods extends Model
{
    // 模型事件
    protected static function init()
    {
        // 新增之前
        self::event('before_insert', function ($data) {
            $data->member_id = '';
            $data->deal_price = 0;
            $data->deal_time = 0;
        });

        self::event('before_write',function ($data) {
           $data->picUrl = uploadImg();
        });
    }
}